//*********************************************************
//
//    Copyright (c) Microsoft. All rights reserved.
//    This code is licensed under the Apache License, Version 2.0.
//    THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
//    ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
//    IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
//    PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
//
//*********************************************************

namespace Microsoft.Research.eResearch.Ontology.Mapping
{
    using System;

    /// <summary>
    /// Use this attribute to decorate a class that implements <see cref="IOntologicalTypeMapper"/> and can
    /// mediate an object of type TargetType.
    /// </summary>
    [AttributeUsage(AttributeTargets.Class, AllowMultiple = false, Inherited = false)]
    public sealed class OntologicalTypeMapperAttribute : Attribute
    {
        /// <summary>
        /// Initializes a new instance of the OntologicalTypeMapperAttribute class.
        /// </summary>
        /// <param name="type">The type of the object that this class can mediate.</param>
        public OntologicalTypeMapperAttribute(Type type)
        {
            this.TargetType = type;
        }

        /// <summary>
        /// Gets the type of the target (i.e. the type of the object to be mediated).
        /// </summary>
        /// <value>The type of the target.</value>
        public Type TargetType { get; private set; }
    }
}
